import request from '@/utils/request'

export function getMenuList() {
  return request({
    url: '/menus',
    method: 'get'
  })
}

export function getMenu(id) {
  return request({
    url: `/menus/${id}`,
    method: 'get'
  })
}

// 新增菜单
export function addMenu(data) {
  return request({
    url: '/menus',
    method: 'post',
    data: data
  })
}

// 修改菜单
export function updateMenu(data) {
  return request({
    url: '/menus',
    method: 'put',
    data: data
  })
}

// 删除菜单
export function deleteMenu(menuId) {
  return request({
    url: '/menus/' + menuId,
    method: 'delete'
  })
}
